/*****************************************************************************
 * Copyright (C) Stacy Curl. All rights reserved.                            *
 * ------------------------------------------------------------------------- *
 * The software in this package is published under the terms of the BSD      *
 * style license a copy of which has been included with this distribution in *
 * the LICENSE.txt file.                                                     *
 *****************************************************************************/
package picounit.features.verify.constraint;

public class OrComparitor implements Comparitor {
	private final Comparitor first;
	private final Comparitor second;

	public OrComparitor(Comparitor first, Comparitor second) {
		this.first = first;
		this.second = second;
	}
	
	public <T extends Comparable<T>> boolean compare(T left, T right) {
		return first.compare(left, right) || second.compare(left, right);
	}

	public String description() {
		return first.description() + " or " + second.description();
	}
}